<template>
	<view class="warp">
		<view class="uni-margin-wrap">
			<view class="uni-header-view">
				<image class="image" :src="'/static/shuijiao.jpg'"></image>
			</view>
			<view class="uni-item-view">
				<view class="uni-item-view-text1">
					{{detail.logistics_name}}
				</view>
				<view class="uni-item-view-text2">
					 地址:{{detail.province}}{{detail.city}}{{detail.county}}{{detail.address}}
				</view>
				<view class="uni-item-view-text2">
					负责人:{{detail.principal}}
				</view>
				<view class="uni-item-view-text2">
					 电话:{{detail.phone}}
				</view>
			</view>
			<view class="uni-item-view">
				<view class="uni-item-view-text1">
					主营线路
				</view>
				<view class="uni-list">
					<block v-for="(value, index) in line_list" :key="index">
						<view class="uni-list-cell" hover-class="uni-list-cell-hover">
							<view class="uni-list-cell-item">
								<view class="uni-list-cell-item-text">
									<block v-if="value.type == 1">
										<text class="text">直达:{{ value.receipt_site_name }}->{{ value.unload_site_name }}</text>
									</block>
									<block v-else>
										<text>中转:{{ value.receipt_site_name }} > {{ value.unload_site_name }} > {{ value.transfer}}</text> 
									</block>
									
									
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
			
			<view class="uni-item-view">
				<view class="uni-item-view-text1">
					联系我们
				</view>
				<view class="uni-list">
					<block v-for="(value, index) in site_list" :key="index">
						<view class="uni-list-cell" hover-class="uni-list-cell-hover">
							<view class="uni-list-cell-item">
								<view class="uni-list-cell-item-text">
									<text class="text">{{index + 1}}.{{ value.site_name }}</text>
								</view>
								<view class="uni-list-cell-item-text">
									<text class="text1">{{value.province}}{{value.city}}{{value.county}}{{value.address}}</text>
								</view>
								<view class="uni-list-cell-item-text">
									<text class="text1">联系电话：{{ value.mobile }}</text>
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
			<view class="uni-footer-view">
				 
			</view>
			<view class="uni-safearea-view">
				 
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				logistics_id:'',
				detail:{},
				site_list:[],
				line_list:[]
			}
		},
		onLoad(option) {
			this.logistics_id = option.logistics_id;
			this.getLogisticsInfoData();
			this.getLineData();
			this.getSiteData();
		},
		methods: {
			getLogisticsInfoData(){
				var data = {
					logistics_id:this.logistics_id,
					page:1,
					page_size:99999
				}
				this.http.sendRequest({
					api:this.api.home.logisticsInfoApi,
					data: data,
					success: res => {
						this.detail = res.data;
						console.log(this.detail)
					},
					fail:err =>{
						
					}
				});
			},
			getLineData(){
				var data = {
					logistics_id:this.logistics_id,
					page:1,
					page_size:99999
				}
				this.http.sendRequest({
					api:this.api.home.logisticsLineApi,
					data: data,
					success: res => {
						this.line_list = res.data.data;
						console.log(this.line_list)
					},
					fail:err =>{
						
					}
				});
			},
			getSiteData(){
				var data = {
					logistics_id:this.logistics_id,
					page:1,
					page_size:99999
				}
				this.http.sendRequest({
					api:this.api.home.logisticsSiteListApi,
					data: data,
					success: res => {
						this.site_list = res.data.data;
						console.log(this.site_list)
					},
					fail:err =>{
						
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	@import '../public/css/company-detail.scss';
</style>
